cc.Class({
  extends: cc.Component,
  initBy: function (t) {
    this.scene = t;
    this.isLookAd = false;
    cc.pvz.TAUtils.trackAdUIShow(cc.pvz.GameConfig.AdType.双倍速度);
  },
  onClickShare: function () {
    var t = this;
    if (!this.isLookAd) {
      this.isLookAd = true;
      cc.pvz.AdUtils.showAdRewardVideo(cc.pvz.GameConfig.AdType.双倍速度, function (e) {
        t.onAdClose(e);
      });
    }
  },
  onAdClose: function (t) {
    this.isLookAd = false;
    if (t) {
      cc.popupManager.removePopup(this);
      cc.pvz.runtimeData.openSpeed = true;
      cc.pvz.runtimeData.speed = 1 == cc.pvz.runtimeData.speed ? 2 : 1;
      this.scene.updateSpeed();
    }
  },
  onClickClose: function () {
    cc.popupManager.removePopup(this);
  }
});